package com.wunu.zn.api.appliance.model;

import java.util.List;
import java.util.Map;

import common.plugin.mybatis.Db;
import common.plugin.mybatis.Model;
import common.plugin.mybatis.Table;

@Table("t_chinaid_product")
public class ProductEntity extends Model<ProductEntity>{
	/**
	 * 查询Banner列表
	 * @param openId
	 * @return
	 */
	public static List<Map<String, Object>> getProductList() {
		
		String sql="SELECT * FROM t_chinaid_product p WHERE p.isDel =0";
		 List<Map<String, Object>> list = Db.find(sql, null);
		  if(list!=null && list.size()>0){
			  return list;
			}
		
		 return null;
	}
	
	 /**
     * 查询商品详情
     * @param machineId
     * @param openId
     * @return
     */
	public static ProductEntity getProductInfo(Integer id) {
		String sql = "SELECT * FROM t_chinaid_product p WHERE id =  #{id} LIMIT 1 ";
		return Db.findFirst(ProductEntity.class, sql, "id", id);
		 
	}
}
